.dialog-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    z-index: 1;

    .dialog-nav {
        display: flex;
        align-items: center;
        padding: 0 22px;
        height: 68px;
        position: relative;

        &:before {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 1px;
            background-color: #f4f5f5;
        }

        &.completed {
            &:after {
                content: "\f373";
                font-family: Ionicons, serif;
                pointer-events: none;
                position: absolute;
                top: 50%;
                right: 22px;
                transform: translateY(-50%);
                font-size: 40px;
                color: #19be6b;
                opacity: .2;
                z-index: 1;
            }
            .dialog-title {
                padding-right: 52px;
            }
        }

        .dialog-avatar {
            flex-shrink: 0;
            margin-right: 12px;
            .user-avatar,
            .icon-avatar {
                width: 42px;
                height: 42px;
                margin: 2px;
                flex-grow: 0;
                flex-shrink: 0;
            }
            .icon-avatar {
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 50%;
                font-size: 26px;
                background-color: #61B2F9;
                color: #ffffff;
                &.project {
                    background-color: #6E99EB;
                }
                &.task {
                    background-color: #9B96DF;
                    font-size: 24px;
                }
            }
        }

        .dialog-title {
            flex: 1;
            width: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;

            .main-title {
                display: flex;
                align-items: center;
                line-height: 22px;
                max-width: 100%;

                .ivu-tag {
                    flex-shrink: 0;
                    margin: 0 6px 0 0;
                    padding: 0 5px;

                    &.ivu-tag-success {
                        padding: 0 6px;
                    }
                }

                .ivu-icon {
                    font-size: 18px;
                    margin-right: 6px;

                    &.completed {
                        color: $primary-color;
                    }
                }

                > h2 {
                    font-size: 17px;
                    font-weight: 600;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

                > em {
                    flex-shrink: 0;
                    font-style: normal;
                    font-size: 17px;
                    font-weight: 500;
                    padding-left: 6px;
                }

                .top-text {
                    flex-shrink: 0;
                    width: 40px;
                    height: 24px;
                    border-radius: 4px;
                    margin-left: 10px;
                    background-color: #8BCF70;
                    color: #FFFFFF;
                    text-align: center;
                    padding-top: 1px
                }
            }

            .sub-title {
                flex-shrink: 0;
                font-size: 12px;
                line-height: 20px;
                padding-top: 2px;
                color: #aaaaaa;

                &.pointer {
                    cursor: pointer;

                    &:hover {
                        color: #888888;
                    }
                }
            }
        }
    }

    .dialog-scroller {
        position: relative;
        flex: 1;
        padding: 0 32px;
        overflow: auto;

        .dialog-list {
            > ul {
                > li {
                    display: flex;
                    flex-direction: row;
                    align-items: flex-end;
                    list-style: none;
                    margin-bottom: 16px;

                    &:first-child {
                        margin-top: 16px;
                    }

                    .dialog-avatar {
                        position: relative;
                        margin-bottom: 20px;
                        flex-shrink: 0;
                        width: 30px;
                        height: 30px;
                    }

                    .dialog-view {
                        display: flex;
                        flex-direction: column;
                        align-items: flex-start;
                        margin: 0 0 0 8px;
                        position: relative;

                        &.text {
                            max-width: 70%;
                        }

                        &:hover {
                            .dialog-head {
                                .dialog-menu {
                                    opacity: 1;
                                }
                            }
                        }

                        .dialog-head {
                            display: flex;
                            align-items: flex-start;

                            .dialog-content {
                                background-color: #F4F5F7;
                                padding: 8px;
                                min-width: 32px;
                                border-radius: 6px 6px 6px 0;
                                display: flex;
                                align-items: flex-start;

                                .content-text {
                                    color: #333333;
                                    > pre {
                                        display: block;
                                        margin: 0;
                                        padding: 0;
                                        line-height: 1.5;
                                        white-space: pre-wrap;
                                        word-wrap: break-word;
                                        word-break: break-word;
                                    }
                                }

                                .content-file {
                                    &.file {
                                        display: inline-block;

                                        .file-box {
                                            background-color: #ffffff;
                                            display: flex;
                                            align-items: center;
                                            padding: 10px 14px;
                                            border-radius: 3px;
                                            width: 220px;

                                            .file-thumb {
                                                width: 36px;
                                            }

                                            .file-info {
                                                margin-left: 12px;
                                                display: flex;
                                                flex-direction: column;
                                                justify-content: center;

                                                .file-name {
                                                    color: #333333;
                                                    font-size: 14px;
                                                    line-height: 18px;
                                                    word-break: break-all;
                                                    text-overflow: ellipsis;
                                                    overflow: hidden;
                                                    display: -webkit-box;
                                                    -webkit-line-clamp: 2;
                                                    -webkit-box-orient: vertical;
                                                }

                                                .file-size {
                                                    padding-top: 4px;
                                                    color: #666666;
                                                    font-size: 14px;
                                                }
                                            }
                                        }
                                    }

                                    &.img {
                                        padding: 0;
                                        display: flex;
                                        max-width: 220px;
                                        max-height: 220px;
                                        border-radius: 6px;
                                        background-color: transparent;
                                        overflow: hidden;

                                        .file-img {
                                            display: flex;
                                            cursor: pointer;
                                        }
                                    }
                                }

                                .content-loading {
                                    display: flex;

                                    .common-loading {
                                        width: 20px;
                                        height: 20px;
                                        margin: 4px;
                                    }
                                }

                                .content-unknown {
                                    text-decoration: underline;
                                }
                            }

                            .dialog-menu {
                                opacity: 0;
                                margin-left: 6px;
                                transition: all 0.3s;

                                .menu-icon {
                                    display: flex;
                                    align-items: center;
                                    border-radius: 4px;
                                    border: 1px solid #ddd;
                                    background-color: #ffffff;

                                    > i {
                                        flex: 1;
                                        display: inline-block;
                                        padding: 4px 6px;
                                        color: #999;
                                        font-size: 13px;
                                        cursor: pointer;

                                        & + i {
                                            border-left: 1px solid #ddd;
                                        }

                                        &:hover {
                                            color: #777;
                                        }
                                    }
                                }
                            }
                        }

                        .dialog-foot {
                            display: flex;
                            align-items: center;
                            padding-top: 4px;
                            height: 21px;
                            line-height: 1;

                            .common-loading {
                                margin: 0 2px;
                                width: 10px;
                                height: 10px;
                            }

                            .time {
                                color: #bbbbbb;
                                font-size: 12px;
                            }

                            .done {
                                display: none;
                                margin-left: 4px;
                                transform: scale(0.9);
                                font-size: 12px;
                                color: $primary-color;
                            }

                            .percent {
                                display: none;
                                margin-left: 4px;
                                cursor: pointer;
                            }
                        }
                    }

                    .dialog-action {
                        align-self: flex-start;
                        display: flex;
                        align-items: flex-start;
                        height: 100%;

                        > * {
                            margin: 0 5px;
                        }

                    }

                    &.history {
                        cursor: pointer;
                        justify-content: center;
                        font-size: 13px;
                        padding: 3px 0;
                        margin: 12px 0;
                        opacity: 0.6;
                        transition: opacity 0.2s;

                        &:hover {
                            opacity: 1;
                        }
                    }

                    &.history-tip {
                        position: relative;
                        padding-top: 60px;

                        .history-text {
                            font-style: normal;
                            position: absolute;
                            top: 10px;
                            left: 50%;
                            height: 22px;
                            line-height: 22px;
                            padding: 0 48px;
                            text-align: center;
                            font-size: 12px;
                            border-radius: 2px;
                            background: #f5f5f5;
                            transform: translateX(-50%);
                        }
                    }

                    &.loading {
                        padding: 12px 0;
                        justify-content: center;

                        .common-loading {
                            margin: 0;
                            width: 18px;
                            height: 18px;
                        }
                    }

                    &.nothing {
                        position: absolute;
                        top: 50%;
                        left: 50%;
                        transform: translate(-50%, -50%);
                        color: #999999;
                    }

                    &.bottom {
                        height: 0;
                        margin: 0;
                        padding: 0;
                    }

                    &.self {
                        flex-direction: row-reverse;

                        .dialog-view {
                            align-items: flex-end;
                            margin: 0 8px 0 0;

                            .dialog-head {
                                flex-direction: row-reverse;

                                .dialog-content {
                                    background-color: $primary-color;
                                    border-radius: 6px 6px 0 6px;

                                    .content-text {
                                        color: #ffffff;
                                    }

                                    .content-file {
                                        &.file {
                                            background-color: #F4F5F7;
                                        }

                                        &.img {
                                            border-radius: 6px;
                                            background-color: transparent;
                                        }
                                    }
                                }

                                .dialog-menu {
                                    margin-left: 0;
                                    margin-right: 6px;
                                }
                            }

                            .dialog-foot {
                                .done {
                                    display: inline-block;
                                }

                                .percent {
                                    display: inline-block;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    .dialog-footer {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        padding: 0 28px;
        margin-bottom: 20px;
        position: relative;

        .dialog-newmsg {
            display: none;
            height: 30px;
            line-height: 30px;
            color: #ffffff;
            font-size: 12px;
            background-color: rgba(0, 0, 0, 0.6);
            padding: 0 12px;
            margin-bottom: 20px;
            margin-right: 10px;
            border-radius: 16px;
            cursor: pointer;
            z-index: 2;;
        }

        .dialog-input {
            background-color: #F4F5F7;
            padding: 10px 52px 10px 12px;
            border-radius: 10px;

            .ivu-input {
                border: 0;
                resize: none;
                background-color: transparent;

                &:focus {
                    box-shadow: none;
                }
            }
        }

        .dialog-send {
            position: absolute;
            top: 0;
            right: 14px;
            bottom: 0;
            font-size: 18px;
            width: 46px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .chat-upload {
            display: none;
            width: 0;
            height: 0;
            overflow: hidden;
        }

        &.newmsg {
            margin-top: -50px;

            .dialog-newmsg {
                display: block;
            }
        }
    }

    .drag-over {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 3;
        background-color: rgba(255, 255, 255, 0.78);
        display: flex;
        align-items: center;
        justify-content: center;

        &:before {
            content: "";
            position: absolute;
            top: 16px;
            left: 16px;
            right: 16px;
            bottom: 16px;
            border: 2px dashed #7b7b7b;
            border-radius: 12px;
        }

        .drag-text {
            padding: 12px;
            font-size: 18px;
            color: #666666;
        }
    }
}

.dialog-wrapper-read-poptip-content {
    display: flex;
    position: relative;

    .read,
    .unread {
        flex: 1;
        max-height: 300px;
        overflow: auto;

        > li {
            list-style: none;
            margin-bottom: 12px;

            .common-avatar {
                width: 100%;
            }

            &:last-child {
                margin-bottom: 6px;
            }

            &.read-title {
                > em {
                    font-size: 18px;
                    font-weight: 600;
                    font-style: normal;
                    padding-right: 6px;
                }
            }
        }
    }

    .unread {
        > li {
            padding-left: 16px;
        }
    }

    &:before {
        content: "";
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 1px;
        background-color: #F4F4F5;
    }
}

.dialog-wrapper-paste {
    margin-top: -4px;

    img {
        max-width: 100%;
        max-height: 1000px;
    }

    > div,
    > img {
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 4px 0;
    }
}

@media (max-width: 768px) {
    .dialog-wrapper {
        .dialog-footer {
            padding: 0 20px;
            margin-bottom: 16px;
        }
    }
}
